// 导入
import request from '@/utils/request'

// 新增
export const saveApi = (data) => {
  return request({
    url: 'api/sysrole/save',
    method: 'post',
    data:data
  })
}
//查询
export const pageApi = (data) => {
  return request({
    url: 'api/sysrole/page',
    method: 'get',
    params: data
  })
}
//修改
export const updateApi = (data) => {
  return request({
    url: 'api/sysrole/update',
    method: 'post',
    data: data
  })
}
//删除
export const deleteApi = (data) => {
  return request({
    url: 'api/sysrole/delete',
    method: 'post',
    data: data
  })
}
//批量删除
export const deleteBatchApi = (data) => {
  return request({
    url: 'api/sysrole/deleteids',
    method: 'post',
    data: data
  })
}
//查询对应等级的角色列表
export const levelApi = (data) => {
  return request({
    url: 'api/sysrole/level',
    method: 'get',
    params: data
  })
}

//查询所有的角色
export const allApi = (data) => {
  return request({
    url: 'api/sysrole/all',
    method: 'get',
    params: data
  })
}
//查询对应角色的菜单和权限
export const roleMenuApi = (data) => {
  return request({
    url: 'api/sysrole/menus',
    method: 'get',
    params: data
  })
}
//角色分配权限
export const updateRoleMenuApi = (data) => {
  return request({
    url: 'api/sysrole/updatemenu',
    method: 'post',
    data: data
  })
}